package com.ruoyi.animal.service.impl;

import java.util.List;

import com.ruoyi.animal.domain.CommerceInfoAnimal;
import com.ruoyi.animal.mapper.CommerceInfoAnimalMapper;
import com.ruoyi.animal.service.ICommerceInfoAnimalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 帮养之家和动物关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-04
 */
@Service
public class CommerceInfoAnimalServiceImpl implements ICommerceInfoAnimalService
{
    @Autowired
    private CommerceInfoAnimalMapper commerceInfoAnimalMapper;

    /**
     * 查询帮养之家和动物关联
     * 
     * @param infoId 帮养之家和动物关联主键
     * @return 帮养之家和动物关联
     */
    @Override
    public CommerceInfoAnimal selectCommerceInfoAnimalByInfoId(Long infoId)
    {
        return commerceInfoAnimalMapper.selectCommerceInfoAnimalByInfoId(infoId);
    }

    @Override
    public CommerceInfoAnimal selectCommerceInfoAnimalByAnimalId(Long animalId) {
        return commerceInfoAnimalMapper.selectCommerceInfoAnimalByAnimalId(animalId);
    }

    /**
     * 查询帮养之家和动物关联列表
     * 
     * @param commerceInfoAnimal 帮养之家和动物关联
     * @return 帮养之家和动物关联
     */
    @Override
    public List<CommerceInfoAnimal> selectCommerceInfoAnimalList(CommerceInfoAnimal commerceInfoAnimal)
    {
        return commerceInfoAnimalMapper.selectCommerceInfoAnimalList(commerceInfoAnimal);
    }

    /**
     * 新增帮养之家和动物关联
     * 
     * @param commerceInfoAnimal 帮养之家和动物关联
     * @return 结果
     */
    @Override
    public int insertCommerceInfoAnimal(CommerceInfoAnimal commerceInfoAnimal)
    {
        return commerceInfoAnimalMapper.insertCommerceInfoAnimal(commerceInfoAnimal);
    }

    /**
     * 修改帮养之家和动物关联(根据商家修改宠物，商家Id不动宠物ID变需要的是在商家界面使用)
     * 
     * @param commerceInfoAnimal 帮养之家和动物关联
     * @return 结果
     */
    @Override
    public int updateCommerceInfoAnimal(CommerceInfoAnimal commerceInfoAnimal)
    {
        return commerceInfoAnimalMapper.updateCommerceInfoAnimal(commerceInfoAnimal);
    }

    /**
     * 修改帮养之家和动物关联(根据宠物修改帮养之家，在宠物的界面里面使用）
     *
     * @param commerceInfoAnimal 帮养之家和动物关联
     * @return 结果
     */
    @Override
    public int updateCommerceInfoAnimalByAnimal(CommerceInfoAnimal commerceInfoAnimal)
    {
        return commerceInfoAnimalMapper.updateCommerceInfoAnimalByAnimal(commerceInfoAnimal);
    }



    /**
     * 批量删除帮养之家和动物关联
     * 
     * @param infoIds 需要删除的帮养之家和动物关联主键
     * @return 结果
     */
    @Override
    public int deleteCommerceInfoAnimalByInfoIds(Long[] infoIds)
    {
        return commerceInfoAnimalMapper.deleteCommerceInfoAnimalByInfoIds(infoIds);
    }

    /**
     * 删除帮养之家和动物关联信息
     * 
     * @param infoId 帮养之家和动物关联主键
     * @return 结果
     */
    @Override
    public int deleteCommerceInfoAnimalByInfoId(Long infoId)
    {
        return commerceInfoAnimalMapper.deleteCommerceInfoAnimalByInfoId(infoId);
    }
}
